package org.nepu.srr.设备设施资料.钻井液净化设备及压力管线证书;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.nepu.sc.domain.CommonIn;
import org.nepu.sc.domain.CommonMethods;


@Data
public class B43DrillingFluidParams {
    @ApiModelProperty("振动筛")
    CommonIn vibrationScreen;

    @ApiModelProperty("除气器")
    CommonIn airFilter;

    @ApiModelProperty("离心机")
    CommonIn centrifuge;

    @ApiModelProperty("联合清洁器")
    CommonIn cleaningUnit;

    @ApiModelProperty("搅拌器")
    CommonIn mixingMachine;

    @ApiModelProperty("灌注泵/混合泵")
    CommonIn injectionPump;

    @ApiModelProperty("砂泵（三除泵）")
    CommonIn sandPump;

    @ApiModelProperty("泵舱至钻台的高压管汇及阀门")
    CommonIn pressureRegulator;

    @ApiModelProperty("钻台立管高压管汇及阀门")
    CommonIn drillingPipePressureRegulator;

    @ApiModelProperty("井口四通至节流压井管汇的高压管汇及阀门")
    CommonIn pressureRegulatorForWellValve;

    @ApiModelProperty("节流压井管汇至试油管汇的高压管汇及阀门")
    CommonIn pressureRegulatorForOilValve;

    @ApiModelProperty("节流压井管汇至钻台立管的高压管汇及阀门")
    CommonIn pressureRegulatorForDrillingPipe;

    @ApiModelProperty("钻井泵安全阀")
    CommonIn safetyValve;

    @ApiModelProperty("试压管汇及阀门")
    CommonIn testPressureRegulator;

    @ApiModelProperty("高压软管")
    CommonIn highPressureSoftPipe;

    @ApiModelProperty("吹灰系统")
    CommonIn floodSystem;

    public B43DrillingFluidResult rate(){
        double fullScore = 140;
        double score = 0;
        if(CommonMethods.isAllTrue(vibrationScreen.getInput())){
            score += 10;
        }
        if(CommonMethods.isAllTrue(airFilter.getInput())){
            score += 10;
        }
        if(CommonMethods.isAllTrue(centrifuge.getInput())){
            score += 5;
        }
        if(CommonMethods.isAllTrue(cleaningUnit.getInput())){
            score += 5;
        }
        if(CommonMethods.isAllTrue(mixingMachine.getInput())){
            score += 5;
        }
        if(CommonMethods.isAllTrue(injectionPump.getInput())){
            score += 10;
        }
        if(CommonMethods.isAllTrue(sandPump.getInput())){
            score += 5;
        }
        if(CommonMethods.isAllTrue(pressureRegulator.getInput())){
            score += 10;
        }
        if(CommonMethods.isAllTrue(drillingPipePressureRegulator.getInput())){
            score += 10;
        }
        if(CommonMethods.isAllTrue(pressureRegulatorForWellValve.getInput())){
            score += 10;
        }
        if(CommonMethods.isAllTrue(pressureRegulatorForOilValve.getInput())){
            score += 10;
        }
        if(CommonMethods.isAllTrue(pressureRegulatorForDrillingPipe.getInput())){
            score += 10;
        }
        if(CommonMethods.isAllTrue(safetyValve.getInput())){
            score += 10;
        }
        if(CommonMethods.isAllTrue(testPressureRegulator.getInput())){
            score += 10;
        }
        if(CommonMethods.isAllTrue(highPressureSoftPipe.getInput())){
            score += 10;
        }
        if(CommonMethods.isAllTrue(floodSystem.getInput())){
            score += 10;
        }
        double rate = score/fullScore;
        B43DrillingFluidResult result = new B43DrillingFluidResult();
        result.setRateScore(rate);
        String s = CommonMethods.toGrade(rate);
        result.setRateResult(s);
        return result;
    }
}
